package org.cid54.bukkit.model;

import java.util.HashSet;
import java.util.Set;
import org.bukkit.entity.Player;

/**
 *
 * @author fgo
 */
public class AquamanRegister {

    public static final AquamanRegister instance = new AquamanRegister();
    private static final Object lock = new Object();
    private Set<String> players = new HashSet<String>();

    public void addPlayer(Player p) {

        synchronized (lock) {
            this.players.add(p.getName());
        }

    }

    public void removePlayer(Player p) {

        synchronized (lock) {
            this.players.remove(p.getName());
        }

    }

    public boolean isPlayerAquaman(Player p) {

        return this.players.contains(p.getName());

    }
}
